package com.example.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

@RestController
public class DemoController {

    @Value("${spring.application.name:defaultName}")
    String appName;

    @GetMapping("/**")
    public Object getTime(HttpServletRequest request){
        String queryString = request.getRequestURL().toString();
        return new Object(){
            public Date time = new Date();
            public String uir = queryString;
            public String name = appName;
        };
    }
}
